package com.itheima.demo3;

/**
 * @auther Macrydy
 * @date 2020/7/13 11:40
 */
public class Student {

    private String name;
    private int age;

    private Student(String name) {
        this.name = name;
        System.out.println("name的值为:" + name);
        System.out.println("private...Student...有参构造方法");
    }

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void study(){
        System.out.println("学生在学习");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    private int method(String brand,int x){
        System.out.println("我要抽"+brand+"牌香烟");
        return 20-x;
    }
}
